<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="../layui/css/layui.css"/>
</head>
<body>
<form class="layui-form" action="">
    <input type="checkbox" name="yyy" lay-skin="switch" lay-text="ON|OFF" checked>
    <select name="city" lay-verify="">
        <option value="">请选择一个城市</option>
        <option value="010">北京</option>
        <option value="021">上海</option>
        <option value="0571">杭州</option>
    </select>
    <input type="checkbox" name="" title="写作" checked>
    <input type="checkbox" name="" title="发呆">
    <input type="checkbox" name="" title="禁用" disabled>
    <input type="radio" name="sex" value="nan" title="男">
    <input type="radio" name="sex" value="nv" title="女">
    <input type="radio" name="sex" value="" title="中性" disabled>
</form>

<div class="layui-progress layui-progress-big" lay-showPercent="yes">
    <div class="layui-progress-bar layui-bg-blue" lay-percent="50%"></div>
</div>

<div class="layui-collapse">
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">杜甫</h2>
        <div class="layui-colla-content layui-show">22</div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">李清照</h2>
        <div class="layui-colla-content">内容区域</div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">鲁迅</h2>
        <div class="layui-colla-content">内容区域</div>
    </div>


</div>
<div class="list">

</div>
<div id="test1"></div>
<textarea id="demo" style="display: none;"></textarea>
<button id="btn">点击</button>
</body>
<script src="../lib/jquery/jquery.js"></script>
<script src="../layui/layui.js"></script>
<script>
    var oooo;
    layui.use(['form', 'element', 'laypage', 'layedit'], function () {
        var form = layui.form;
        var element = layui.element;
        var laypage = layui.laypage;


        var layedit = layui.layedit,
            $ = layui.jquery;
        var index = layedit.build('demo', {
            tool: ['strong', 'italic', 'underline', '|', 'left', 'center', 'right',  '|', 'link', 'unlink'],
            uploadImage: {
                url: 'http://139.196.113.202/huoban-sales/http/sales/user/image/api_ie/upload.do', //接口url
                type: 'post',
                success: function (data) {
                    console.log(data)
                }
            },
            height: 340
        });
        $('#btn').click(function () {
            var cal=layedit.getContent(index);
            console.log(cal)
        });


        //监听提交
        form.on('submit(formDemo)', function (data) {
            layer.msg(JSON.stringify(data.field));
            return false;
        });
        var data = {
            currentPage: 1
        };

        function getList() {
            $.post('http://139.196.113.202/huoban-sales//http/sales/function/community/findSuggesList.do', data, function (res) {
                console.log(res)
                if (res.status == 200) {
                    $('.list').empty()
                    res.data.list.forEach(function (item, index) {
                        var html = '';
                        html = '<p>' + item.id + '</p>';
                        $('.list').append(html)
                    });

                    laypage.render({
                        elem: 'test1',
                        count: res.data.totalCount,//数据总数，从服务端得到
                        curr: res.data.currentPage,
                        jump: function (obj, first) {
                            if (!first) {
                                data.currentPage = obj.curr;
                                getList()
                            }
                        }
                    });
                }
            });

        }

        getList()

    });




    $('#click').click(function () {
        var tex = $('.layui-unselect em').text();
        console.log(tex)
        console.log($('input[type="radio"]:checked').val())
    });

    if (true) {
        //$('.layui-form input').attr('checked',false);
        $('input[value="nv"]').attr('checked', true)
    }


</script>
</html>